<template>
  <van-form >
    <van-cell-group inset>
      <van-field
          v-model="form.name"
          name="name"
          label="名称"
      />
      <van-field
          v-model="form.description"
          name="description"
          label="描述"
      />
    </van-cell-group>
    <div style="margin: 16px;display: flex;justify-content: center">
      <slot></slot>
    </div>
  </van-form>
</template>
<script setup lang="ts" name="Detail">
import {useResetReactive} from "../../hooks";

const [form, resetForm] = useResetReactive({
  name: "",
  description:'',
});
resetForm();

async function setProps({values}){
  form.name = values.name;
  form.description = values.description;
}

function getValue(){
  return form
}
defineExpose({setProps,getValue})
</script>
